# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdatePolicy do
  @moduledoc """
  Parameters of the update process.

  ## Attributes

  - autoPauseAfterInstances (integer()): Number of instances to update before the updater pauses the rolling update. Defaults to: `null`.
  - instanceStartupTimeoutSec (integer()): The maximum amount of time that the updater waits for a HEALTHY state after all of the update steps are complete. If the HEALTHY state is not received before the deadline, the instance update is considered a failure. Defaults to: `null`.
  - maxNumConcurrentInstances (integer()): The maximum number of instances that can be updated simultaneously. An instance update is considered complete only after the instance is restarted and initialized. Defaults to: `null`.
  - maxNumFailedInstances (integer()): The maximum number of instance updates that can fail before the group update is considered a failure. An instance update is considered failed if any of its update actions (e.g. Stop call on Instance resource in Rolling Reboot) failed with permanent failure, or if the instance is in an UNHEALTHY state after it finishes all of the update actions. Defaults to: `null`.
  - minInstanceUpdateTimeSec (integer()): The minimum amount of time that the updater spends to update each instance. Update time is the time it takes to complete all update actions (e.g. Stop call on Instance resource in Rolling Reboot), reboot, and initialize. If the instance update finishes early, the updater pauses for the remainder of the time before it starts the next instance update. Defaults to: `null`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :autoPauseAfterInstances => any(),
          :instanceStartupTimeoutSec => any(),
          :maxNumConcurrentInstances => any(),
          :maxNumFailedInstances => any(),
          :minInstanceUpdateTimeSec => any()
        }

  field(:autoPauseAfterInstances)
  field(:instanceStartupTimeoutSec)
  field(:maxNumConcurrentInstances)
  field(:maxNumFailedInstances)
  field(:minInstanceUpdateTimeSec)
end

defimpl Poison.Decoder, for: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdatePolicy do
  def decode(value, options) do
    GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdatePolicy.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ReplicaPoolUpdater.V1beta1.Model.RollingUpdatePolicy do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
